<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="./public/admin/bootstrap/css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="./public/admin/bootstrap/css/bootstrap-responsive.min.css"/>
		<script src="bootstrap/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="./public/admin/css/content.css"/>
		<link rel="stylesheet" type="text/css" href="./public/admin/css/header.css"/>
		<link rel="stylesheet" type="text/css" href="./public/admin/css/footer.css"/>		
		
		<script src="./public/admin/js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
		<title></title>
	</head>
	<body>
		{{include file="VIEW_PATH/Common/header.php"}}
		
		<script type="text/javascript">
			$(function(){
				$('.s_img').click(function(){
					var c = $(this).attr('src');
					$('.m_img').attr('src',c );
					$('.bigImg').attr('src',c );
								
				})													
							
			})
		</script>
		
		<article>
			<div class="banner">
				<div class="logo">
					<img src="./public/admin/images/content/c_banner.png"/>
				</div>								
			</div>
			
			<div class="leader">
				<p >					
				<a href="">BOYS首页</a> 
				&gt<a href="">鞋靴</a>
				&gt<a href="">休闲/运动鞋</a>
				&gt<a href="">{{$shoeData[0]['gname']}}</a>
				</p>
			</div>
			
			<div class="jieshao">
				<div class="big_p">
					<img class="m_img" src="{{$shoeData[0]['photo'][0]}}" alt="" style="width: 420px; height: 560px;"/>
					<div class="box"></div>
						<div class="gaiz"></div>
						 <!--右侧大图-->
						 <div class="bigbox">
						 	<!--<img src="{{$shoeData[0]['photo'][0]}}" alt=""  class="bigImg" style="width: 840px; height: 1120px;"  />-->
						 </div>
				</div>
				<div class="sm_p" >
					{{foreach from="$shoeData[0]['photo']" key="$k" value="$v"}}
					<p>
					<img class="s_img" src="{{$v}}"/>
					</p>
					{{endforeach}}
				</div>
				<div class="shuju">
					<form action="" method="post" enctype="multipart/form-data">
						
					
					<p class="name">{{$shoeData[0]['gname']}}</p>

					<a href="" class="brand-name">{{$brand}}</a>
					<p style="margin-top: 5px;"><span style="color:#999;font-size: 12px;">促销价：</span> 
						<span  style="   color: #000;font-size: 22px;line-height: 24px;font-weight: 700;">¥{{$shoeData[0]['shopprice']}}.00</span></p>

					<p class="vip-price" >市场价：<del>¥{{$shoeData[0]['marketprice']}}.00</del></p>
					<img src="./public/admin/images/content/c_sm_2.png"/>
					<hr>
					
					{{foreach from="$shoeData" key="$k" value="$v"}}
					<p class="chose-size" ">
						<span>选{{$v['taname']}}：</span>
						 {{foreach from="$v['sonData']" key="$kk" value="$vv"}}
						<a class='zuhe' href="javascrippt:; " gaid="{{$vv['gaid']}}" taname="{{$v['taname']}}" value="{{$vv['ganame']}}">{{$vv['ganame']}}</a>
						{{endforeach}}
					</p>
					{{endforeach}}	
					<p class="chose-inventory">(库存: )</p>						
					<p class="change-num">
						选数量:<input type="button" id="raduce-num" value="-" style="width:20px;background: #ccc;border: 0;"/>
						<input type="text" class="chose-num" name="num" id="" value="1" style="margin-bottom: 0px;text-align: center;"/>
						<input type="button" id="add-num" value="+" style="width:20px;background: #ccc;border: 0;"/>
						</p>


					<div class="">
						<input type="hidden" name="combine" id="combine" value="" />											
						<input type="hidden" name="gid" id="" value="{{Q('get.gid',0,'intval')}}" />											
					<input href="" class="addshop" type="submit"  value="添加到购物车"><a href="" class="collect">收藏商品</a>
					</div>
					<p class="share">分享商品:</p>
					<div class="dis_ipt"></div><div class="dis_ipt1"></div>
					</form>
				</div>
				<div id="neirong" >
					<div class="">
						<p >商品信息</p>
						<p>
							{{foreach from="$shoeAttrData" key="$k" value="$v"}}
							<span>{{$v['taname']}}：{{$v['ganame']}}</span>
							{{endforeach}}
						</p>
					</div>
					{{$shoeData[0]['intro']}}
					{{$shoeData[0]['service']}}
				</div>
				
			</div>
			
			<br />

				
			
		</article>
<script type="text/javascript">
		$(function(){
								
			$('.chose-size a[taname="颜色"]').click(function(){
							$(this).css({border:"1px solid #000"}).siblings().css({border:"1px solid #eaeceb"});
									
							 colorgaid=$(this).attr('gaid'); 	
									
							var attr='';
							attr+='<input type="hidden"  name="color"  value="'+colorgaid+'" />';
							$('.dis_ipt').html(attr);
//							alert(colorgaid);
								})		
								
							$('.chose-size a[taname="尺码"]').click(function(){
									$(this).css({border:"1px solid #000"}).siblings().css({border:"1px solid #eaeceb"});
									
									 sizegaid=$(this).attr('gaid'); 	
									
									var attr='';
									attr+='<input type="hidden"  name="size"  value="'+sizegaid+'" />';
									$('.dis_ipt1').html(attr);
//									alert(sizegaid);
								})																				
								
								$('.zuhe').click(function(){
									var combine=colorgaid+','+sizegaid;
//									alert(combine);	
									$('input[name=combine]').val(combine);	
									
									$.ajax({
										type:"post",
										url:"{{U('getCombine',array('gid'=>$_GET['gid']))}}",
										data:{combine:combine},
										dataType:'json',
										success:function(phpData){
//											alert(phpData);
											if(phpData==null){
												phpData=0;
												var attr='';
												attr+='<p class="chose-inventory" style="color:red;">(库存不足)</p>';
												$('.chose-inventory').html(attr);
//												alert('该尺码缺货，请重新选择！');
												$('.change-num').hide();
												$('.addshop').hide();
											}else{
												var attr='';
												attr+='<p class="chose-inventory" >(库存: '+phpData+')</p>';
												attr+='<input type="hidden"  name="inventory"  value="'+phpData+'" />';
												$('.chose-inventory').html(attr);
												$('.change-num').show();
												$('.addshop').show();	
											}
											
										}										
									});
								})													
							})			
		</script>
		<script type="text/javascript">
			$(function(){
				
				$('#add-num').click(function(){
					num=parseInt($('.chose-num').val());
//									alert(num);									
					num=num+1;
					if(num<=0){num=0;}
					$('.chose-num').val(num);
				})

				$('#raduce-num').click(function(){
					num=parseInt($('.chose-num').val());
//									alert(num);									
					num=num-1;
					if(num<=0){num=0;}
					$('.chose-num').val(num);
				})
				
				$('.addshop').click(function(){
					alert('添加到购物车成功');
				})
			})
		</script>			

		{{include file="VIEW_PATH/Common/footer.php"}}
	</body>
</html>
